#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import userinfo_blueprint
from api_1_0.userInfoResource.userInfoResource import UserInfoResource
from api_1_0.userInfoResource.userInfoOtherResource import UserInfoOtherResource
from app import limiter

api = Api(userinfo_blueprint)

api.add_resource(UserInfoResource, '/userInfo/<UserID>', '/userInfo', endpoint='userInfo')


#API  失效的用户级别验证+访问次数限制
@userinfo_blueprint.route('/userInfo/loginv1', methods=['POST'], endpoint='userInfo_loginv1')
def UserInfo_loginv1():
    return UserInfoOtherResource.loginv1()

#API  SQL注入
@userinfo_blueprint.route('/userInfo/myquery', methods=['GET'], endpoint='userInfo_myquery')
def UserInfo_myquery():
    return UserInfoOtherResource.myquery()

#API  解决缺陷失效的用户级别验证
# @userinfo_blueprint.route('/userInfo/login', methods=['POST'], endpoint='userInfo_login')
# @limiter.limit("5 per minute")
# def UserInfo_login():
#     return UserInfoOtherResource.login()

# 获取验证码
# @userinfo_blueprint.route('/userInfo/getverifycode', methods=['GET'], endpoint='userInfo_getverifycode')
# @limiter.limit("5 per minute")
# def UserInfo_getverifycode():
#     return UserInfoOtherResource.getverifycode()



# API  资源缺乏或速率限制
# @userinfo_blueprint.route('/userInfo/query', methods=['GET'], endpoint='userInfo_query')
# @limiter.limit("5 per minute")
# def UserInfo_query():
#     return UserInfoOtherResource.joint_query()











# # 点击评论我的
# # @userinfo_blueprint.route('/userInfo/commentme', methods=['GET'], endpoint='userInfo_commentme')
# # def UserInfo_commentme():
# #     return UserInfoOtherResource.commentme()
# #
# # # 点击评论我的
# # @userinfo_blueprint.route('/userInfo/search_byname', methods=['GET'], endpoint='userInfo_search_byname')
# # def UserInfo_search_byname():
# #     return UserInfoOtherResource.search_byname()
# #
# # # 点击回复我的
# # @userinfo_blueprint.route('/userInfo/replyme', methods=['GET'], endpoint='userInfo_replyme')
# # def UserInfo_replyme():
# #     return UserInfoOtherResource.replyme()
# #
# # # 点击点赞我的
# # @userinfo_blueprint.route('/userInfo/upvoteme', methods=['GET'], endpoint='userInfo_upvoteme')
# # def UserInfo_upvoteme():
# #     return UserInfoOtherResource.upvoteme()
# #
# # #推荐文章查询
# # @userinfo_blueprint.route('/userInfo/recommend', methods=['GET'], endpoint='userInfo_recommend')
# # def UserInfo_recommend():
# #     return UserInfoOtherResource.recommend()